package utils.handlers;

import org.apache.poi.ss.usermodel.Sheet;

import com.alibaba.excel.write.handler.SheetWriteHandler;
import com.alibaba.excel.write.metadata.holder.WriteSheetHolder;
import com.alibaba.excel.write.metadata.holder.WriteWorkbookHolder;

public class FreezeWriteHandler implements SheetWriteHandler
{
	public int colSplit = 1, rowSplit = 1, leftmostColumn = 1, topRow = 1;

	@Override
	public void beforeSheetCreate(WriteWorkbookHolder writeWorkbookHolder, WriteSheetHolder writeSheetHolder)
	{

	}

	@Override
	public void afterSheetCreate(WriteWorkbookHolder writeWorkbookHolder, WriteSheetHolder writeSheetHolder)
	{
		int size=writeSheetHolder.getHead().get(0).size();
		Sheet sheet = writeSheetHolder.getSheet();
		sheet.createFreezePane(colSplit, size, leftmostColumn, size);
	}
}
